# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=unicode-character-database
pkgver=15.1.0
pkgrel=1
pkgdesc="Unicode Character Database"
url="https://www.unicode.org/"
arch=(any)
license=(Unicode-TOU)
source=(
  "UCD-$pkgver.zip::https://www.unicode.org/Public/zipped/$pkgver/UCD.zip"
  "Unihan-$pkgver.zip::https://www.unicode.org/Public/zipped/$pkgver/Unihan.zip"
  "unicode-license.txt::https://www.unicode.org/license.txt"
)
noextract=({UCD,Unihan}-$pkgver.zip)
b2sums=('6280ee4c7044bf72cfc1f04c02c06bda1052c4909b2209d41a0ddef3e1eca7d639afa293d1536d1af1ef118311327ec4ec52cdefe8eac081bc84738972993a0e'
        'a92e3fa3dfb765b94641596b67779385edf519b788192a2798b27107fc6860cedc00d445066dad67746b7cd04a7fd2ed5a0f2b65a864d52f043750ad37cd318d'
        '6080afc673ec240857ce121b6e1bd916e89ff3cd60d98667da488d2adee8fddbb0709eb5a4e3b95869232cf543d33c3a69db9eb2978038d5d3365988d3d32207')

package() {
  local x
  for x in UCD Unihan; do
    install -Dm644 $x-$pkgver.zip "$pkgdir/usr/share/unicode/$x.zip"
    bsdtar -C "$pkgdir/usr/share/unicode" -x --no-same-owner --no-same-permissions -f $x-$pkgver.zip
  done

  # FS#49938: A bunch of compatibility symlinks
  ln -s . "$pkgdir/usr/share/unicode/ucd"
  for x in $pkgname unicode-data unidata; do
    ln -s unicode "$pkgdir/usr/share/$x"
  done

  install -Dm644 unicode-license.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim:set sw=2 sts=-1 et:
